<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">

<head>
	<meta charset="utf-8">
	<title>账单一览</title>
	<script type="application/javascript" src="/static/js/common.js"></script>
</head>
<body>
	<nav class="nav">
		<a class="button button-link left" onclick="history.back();">
			<svg class="icon" aria-hidden="true">
				<use xlink:href="#icon-fanhui-"></use>
			</svg>返回
		</a>
		<a class="button button-link right" onclick="history.go(0);">
			<svg class="icon" aria-hidden="true">
				<use xlink:href="#icon-zhuanfa-"></use>
			</svg>刷新
		</a>
		<h1 class="title">日常账单</h1>
	</nav>
	<div class="app-content" style="overflow: unset">
		<div class="weui-pull-to-refresh__layer">
			<div class='weui-pull-to-refresh__arrow'></div>
			<div class='weui-pull-to-refresh__preloader'></div>
			<div class="down">下拉刷新</div>
			<div class="up">释放刷新</div>
			<div class="refresh">正在刷新</div>
		</div>
		<div class="weui-msg">
			<div class="weui-form-preview">
				<div class="weui-form-preview__hd">
					<label class="weui-form-preview__label">总计金额</label>
					<em class="weui-form-preview__value">￥[[${bills.getTotal()}]]</em>
				</div>
				<div class="weui-form-preview__bd" th:each="bill:${bills.getBills()}">
					<div class="weui-form-preview__item">
						<label class="weui-form-preview__label" th:text="${bill.getAccountName()}"></label>
						<span class="weui-form-preview__value">
							<span th:if="${bill.getMoney() > 0}">-</span>
                            <span th:if="${bill.getMoney() < 0}">+</span>
							￥
							<span th:text="${bill.getAbsMoney()}"></span>
						</span>
					</div>
				</div>
			</div>
			<div class="weui-footer">
				<p class="weui-footer__text">PS:本页面为实时查询数据，可下拉刷新</p>
				<p class="weui-footer__text">统计截止时间：
					[[${#dates.format(bills.getDate(), 'yyyy-MM-dd HH:mm:ss')}]]
				</p>
			</div>
		</div>
	</div>
<script type="application/javascript">
	$(".app-content").pullToRefresh(function () {

		$.confirm("是否刷新当日账单？", function() {
			//点击确认后的回调函数
			location.reload();
		});

		$(".app-content").pullToRefreshDone();
	});
</script>
</body>
</html>
